import matplotlib.pyplot as plt
import pandas as pd
df=pd.read_excel('cjd.xlsx')
plt.rcParams['font.sans-serif']='SimHei'
x=df['数学']
plt.xlabel('人数')
plt.ylabel('数学成绩')
plt.title('数学成绩人数分布直方图')
plt.hist(x,bins=12,color=(0.894,0,0.498),edgecolor='k')
plt.show()